package com.yizhi.service.Impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.yizhi.domain.dto.UserFormDTO;
import com.yizhi.domain.entityDO.UserDO;
import com.yizhi.domain.vo.UserVO;
import com.yizhi.mapper.UserMapper;
import com.yizhi.mapper.WorksManageMapper;
import com.yizhi.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yizhi.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 管理员信息表 服务实现类
 * </p>
 *
 * @author zhouyihe
 * @since 2024-04-16
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements IUserService {
    
    @Autowired
    private WorksManageMapper worksManageMapper;
    @Autowired
    private UserMapper userMapper;
    
    @Override
    public PageResult pageQuery(UserFormDTO userFormDTO) {
        PageHelper.startPage(userFormDTO.getPage(),userFormDTO.getPageSize());
        Page<UserVO> page = userMapper.pageQuery(userFormDTO);
        return new PageResult(page.getResult(),page.getTotal());
    }
    
    @Override
    public UserDO selectByUsername(String username) {
        return userMapper.selectByUsername(username);
    }
    
    
}
